cmake_minimum_required(VERSION 3.16)

project(pcapio LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    message(${PROJECT_SOURCE_DIR})
    set(PCAP_LIB wpcap)
    if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
        link_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/npcap/Lib/x64)
    else()
        link_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/npcap/Lib)
    endif()
    include_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/npcap/Include)
else()
    set(PCAP_LIB pcap)
endif()

set (PRJ_HEADERS
    pcapio.h
)

set (PRJ_SOURCES
    pcapio.cpp
)
add_executable(pcapio
    ${PRJ_HEADERS}
    ${PRJ_SOURCES}
    main.cpp
)

target_link_libraries(pcapio
    ${PCAP_LIB}
    ${PCAPLinkExtra})
